package com.ximu.service_edu.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.ximu.service_edu.entity.EduSubject;
import com.ximu.service_edu.entity.excel.ExcelSubjectData;
import com.ximu.service_edu.service.EduSubjectService;

/**
 * @projectName: guli
 * @package: com.ximu.service_edu.listener
 * @className: SubjectExcelListener
 * @author: ximu
 * @description: TODO
 * @date: 2022/4/5 11:11
 * @version: 1.0
 */
public class SubjectExcelListener extends AnalysisEventListener<ExcelSubjectData> {

    public EduSubjectService subjectService;
    public SubjectExcelListener() {}
    //创建有参数构造，传递subjectService用于操作数据库
    public SubjectExcelListener(EduSubjectService subjectService) {
        this.subjectService = subjectService;
    }

    //一行一行去读取excel内容
    @Override
    public void invoke(ExcelSubjectData excelSubjectData, AnalysisContext analysisContext) {
        if(excelSubjectData == null) {
            System.out.println("excel为空");
        }
        /*
         * @param excelSubjectData:
        	 * @param analysisContext:
          * @return void
         * @author ximu
         * @description TODO 不会写了
         * @date 2022/4/5 11:49
         */
    }



    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
